package com.mingshine.cloud.listener;

import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.stereotype.Component;

@Component
public class Consumer2 {

    @KafkaListener(topics = "ms_test_topics", groupId = "1")
    public void listener1(ConsumerRecord<?, ?> consumerRecord) {
        System.out.printf("222222======topic = %s, offset = %d, value = %s \n", consumerRecord.topic(), consumerRecord.offset(), consumerRecord.value());
    }
//
//    @KafkaListener(topics = "ms_test_topics", groupId = "2")
//    public void listener2(ConsumerRecord<?, ?> consumerRecord) {
//        System.out.printf("22222222222======topic = %s, offset = %d, value = %s \n", consumerRecord.topic(), consumerRecord.offset(), consumerRecord.value());
//    }
//
//    @KafkaListener(topics = "ms_test_topics", groupId = "3")
//    public void listener3(ConsumerRecord<?, ?> consumerRecord) {
//        System.out.printf("333333333333======topic = %s, offset = %d, value = %s \n", consumerRecord.topic(), consumerRecord.offset(), consumerRecord.value());
//    }
   
}
